package com.supor.aiot.food.api;

import com.android.baseconfig.base.BaseApiResult;
import com.android.baseconfig.base.BaseRetrofit;
import com.supor.aiot.food.bean.RecipeThumbsBean;
import com.supor.aiot.food.ui.food.FoodViewModel;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;

/**
 * @author: zook
 * @date: 2021/11/4
 */
public class FoodImpl extends BaseRetrofit<FoodService> implements FoodService {
    private static FoodImpl instance;

    public static FoodImpl getInstance() {
        if (instance == null) {
            instance = new FoodImpl();
        }
        return instance;
    }

    @Override
    public Observable<BaseApiResult<RecipeThumbsBean>> recipeThumbs(RequestBody requestBody) {
        return api.recipeThumbs(requestBody).compose(this.applySchedulers());
    }

    @Override
    public Observable<BaseApiResult<String>> recipeThumbsDel(String id) {
        return api.recipeThumbsDel(id).compose(this.applySchedulers());
    }
}
